<template>
    <div class="row">
        <el-checkbox v-model="comp.enabled">{{ comp.__classname__ }}</el-checkbox>
        <el-button round size="small" :icon="Document" @click="gm.toConsole(comp)"></el-button>
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>BarSprite</el-text>
        <el-input size="small" disabled :value="gm.targetName(comp.barSprite)" />
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>Mode</el-text>
        <el-select v-model="comp.mode" size="small">
            <el-option v-for="item in mode.__enums__" :key="item.value" :label="item.name" :value="item.value" />
        </el-select>
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>TotalLength</el-text>
        <el-input-number size="small" :controls="false" :step="0.1" v-model="comp.totalLength" />
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>Progress</el-text>
        <el-slider size="small" show-input :show-input-controls="false" :show-tooltip="false" :step="0.1" :min=0 :max=1 v-model="comp.progress" />
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>Reverse</el-text>
        <el-checkbox v-model="comp.reverse" />
    </div>
</template>

<script lang="ts" setup>
import { Document } from '@element-plus/icons-vue'
import gm from './gm';

defineProps<{
    comp: CCComponent,
    update: Number,
}>()
const mode = cc.ProgressBar.Mode
</script>